package com.example.mymusicdisplay.utils;

import android.media.MediaPlayer;

/**
 * author: ts
 * created on: 2021/10/28 上午9:11
 * description:
 */
public class MediaPlayerUtil {
    private volatile static MediaPlayer mMediaPlayer;

    public MediaPlayerUtil() {
    }

    public static MediaPlayer getInstance() {
        if (mMediaPlayer == null) {
            synchronized (MediaPlayerUtil.class) {
                if (mMediaPlayer == null) {
                    mMediaPlayer = new MediaPlayer();
                }
            }
        }
        return mMediaPlayer;
    }
}
